#ifndef __DB_H__
#define __DB_H__
#include <mysql.h>

extern char dbhost[];
extern char dbname[];
extern char dbuser[];
extern char dbpass[];

#ifdef __cplusplus
extern "C" {
#endif
int db_setConfig(const char *dbhost, const char *dbuser, const char *dbpass, const char *dbname);
int db_connect(MYSQL *conn);
int db_close(MYSQL *conn);

MYSQL_RES *db_doSql(MYSQL *conn, const char *sql);
char *db_escape(MYSQL *conn, const char *str);

#ifdef __cplusplus
};
#endif
#endif
